//Accepted
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <iostream>
#include <list>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;


int main (){
	//freopen("in.txt", "r", stdin);//freopen("out.txt", "w", stdout);
	int n, m, i, j, a[100], x, y;
	bool ok;
	
	memset(a,0,sizeof(a));
	scanf("%d%d", &n, &m);
	for(i=0;i<m;++i){
		scanf("%d%d", &x, &y);
		for(j=x-1;j<y;++j){
			++a[j];
		}
	}
	for(ok=1,i=0;i<n&&ok;++i){
		if(a[i]!=1)ok=0;
	}
	if(ok)printf("OK");
	else printf("%d %d", i, a[i-1]);
	
	return 0;
}
